import { requestGet,requestPost,requestPut,requestDelete } from "../utils/request";
// 获取左侧菜单权限
let getMenus = ()=>requestGet(`menus`);

//获取用户列表数据
let getUserList = (data)=>requestGet(`users`,data);

//获取角色数据列表
let getCharactList = (data)=>requestGet(`roles`,data)

//获取商品列表
let getGoods = (data)=>requestGet(`goods`,data)

//获取商品分类数据列表
let goodsclassify = (data)=>requestGet(`categories`,data)

//获取折线图数据

let getChartData = (data)=>requestGet(`reports/type/1`,data)

//获取分类参数数据
let getCateData = (data)=>requestGet(`categories/:id/attributes`,data)

//获取添加用户请求
let addUsers = (data)=>requestPost(`users`,data)

//获取用户详情信息
let getUserMsg = (id)=>requestGet(`users/${id}`)

//编辑用户
let updateUser = (id,data)=>requestPut(`users/${id}`,data)


//删除用户
let deleteUser = (id)=>requestDelete(`users/${id}`)

//分配角色
let fpUser = (id,data)=>requestPut(`users/${id}/role`,data)


export {
    getMenus,
    getUserList,
    getCharactList,
    getGoods,
    goodsclassify,
    getChartData,
    getCateData,
    addUsers,
    getUserMsg,
    updateUser,
    deleteUser,
    fpUser
    
}